<template>
	<div class="task-container">
		<el-tabs v-model="activeName" @tab-click="handleClick">
            
            <el-tab-pane label="任务大厅" name="first">
                <!-- 内容一 -->

                <template v-if="tasklist">
                    <div class="is-empty">
                        <img src="/img/is_empty.png">
                        <p>没有更多了...</p>
                    </div>
                </template>
            </el-tab-pane>
            
            <el-tab-pane label="我发布的" name="second">
                <!-- 内容二 -->
                <div class="second-container">
                    <el-row>
                        <router-link to="/publish">
                            <el-button type="primary">发布新任务</el-button>
                        </router-link>
                    </el-row>
                </div>

                <template v-if="taskmine">
                    <div class="is-empty">
                        <img src="/img/is_empty.png">
                        <p>没有更多了...</p>
                    </div>
                </template>
            </el-tab-pane>
            
			<el-tab-pane label="我领取的" name="third">
                <!-- 内容三 -->
                
                <template v-if="taskgets">
                    <div class="is-empty">
                        <img src="/img/is_empty.png">
                        <p>没有更多了...</p>
                    </div>
                </template>
            </el-tab-pane>

        </el-tabs>
	</div>
</template>

<script>
	export default {
		data() {
			return {
                activeName: "first",
                tasklist: [],
                taskmine: [],
                taskgets: []
			};
		},
		methods: {
			handleClick(tab, event) {
				console.log(tab, event);
			}
		}
	};
</script>

<style>
    .el-tabs__header {
        margin: 0;
    }
	.el-tabs__nav {
		width: 100%;
	}
	.el-tabs__item {
		width: 33.3333333%;
        text-align: center;
        font-weight: 400;
	}
	.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
	.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
	.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
	.el-tabs--top .el-tabs__item.is-top:nth-child(2) {
		padding-left: 20px;
	}
	.el-tabs--bottom .el-tabs__item.is-bottom:last-child,
	.el-tabs--bottom .el-tabs__item.is-top:last-child,
	.el-tabs--top .el-tabs__item.is-bottom:last-child,
	.el-tabs--top .el-tabs__item.is-top:last-child {
		padding-right: 20px;
    }
</style>

<style scoped>
    .second-container {
        width: 100%;
        padding: 20px;
        margin-bottom: 50px;
        background-color: #fff;
    }
    .second-container .el-button {
        width: calc( 100% - 40px);
    }
    .is-empty {
        text-align: center;
        position: relative;
        width: 136px;
        margin: 0 auto;
        margin-top: 100px;
        color: var(--color-minor);
    }
    .is-empty p {
        padding-top: 15px;
    }
</style>
